﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RuleCode.Enum;
using RuleCode.Table;

namespace map.member
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            cbuser u = cbuser.Find(" cbuserid = '" + AliApi.appUserId + "'");
            if (!(u.BokerStatus ==BrokerStatus.Common))
            {
                if (u.BokerStatus == BrokerStatus.Require)
                {
                    Button1.Enabled = false;
                    Label1.Text = "已经申请，请等待审核。";
                }
                else
                {
                    Button1.Enabled = false;
                    Label1.Text = "您的经纪人申请已审核通过。";
                }
            }
            
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            cbuser u = cbuser.Find(" cbuserid = '" + AliApi.appUserId + "'");
            u.BokerStatus = RuleCode.Enum.BrokerStatus.Require;
            u.BrokerPrice.StringValue = TextBox1.Text;
            u.Modify();
            Label1.Text = "已经申请，请等待审核。";
            Button1.Enabled = false;

        }
    }
}
